import {createAction, createThunkAction} from "../../lib/redux-utils";
import {get, postForm, postJson} from "../../lib/http";

const path = "/hisGhOrder";
const ACTION_PREFIX = "HISGHORDERPAYABLE.";
export const showEdit = createAction(ACTION_PREFIX + "SHOW_EDIT");
export const hideEdit = createAction(ACTION_PREFIX + "HIDE_EDIT");
export const select = createAction(ACTION_PREFIX + "SELECT");
export const query = createThunkAction(ACTION_PREFIX + "QUERY", params =>
    postJson(path + "/query", params)
);
export const importConsolidate = createThunkAction(ACTION_PREFIX + "IMPORT", params =>
    postForm(path + "/importOut", params)
);
export const del = createThunkAction("", params =>
    get(path + "/del/" + params)
);
export const createNew = createThunkAction(ACTION_PREFIX + "CREATE_NEW", params =>
    postJson(path + "/createNew", params)
);
export const exportData = createThunkAction(ACTION_PREFIX + "EXPORT", params =>
    postJson(path + "/export", params)
);

